#include "clickedLabel.h"
#include <QMessageBox>

void ClickedLabel::mouseReleaseEvent(QMouseEvent *e)//释放
{
    QString sty;
    if (m_Flag==0)
        sty="background-color:rgba(255,255,255,0)";
    else
        sty="color:rgb(255,255,255);background-color:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 rgb(30, 30, 30),stop:0.505682 rgb(0,0,0),stop:1 rgb(0,0,0));border:2px solid rgb(255,255,255);border-radius:5px;";
     this->setStyleSheet(sty);
    emit Clicked(this);
}
void ClickedLabel::mousePressEvent(QMouseEvent *e)  //按下
{
    QString sty;
    if (m_Flag==0)
        sty="background-color:rgba(255,255,255,20)";
    else
        sty="color:rgb(255,255,255);background-color:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 rgb(123, 123, 255),stop:0.505682 rgb(0,0,255),stop:1 rgb(0,0,255));border:2px solid rgb(255,0,0);border-radius:5px;";
        this->setStyleSheet(sty);
}
